package tp.pr4;

/**
 * An enum class that represents the compass directions (North, east, 
 * south and west) plus a value that represents an unknown direction.
 * @author Alvaro Saez Hernando
 * @author Noel Clemente Montero 
 */
public enum Direction {
	EAST,NORTH,SOUTH,WEST,UNKNOWN;
	
	/**
	 * This method return the opposite direction that enter.
	 * @return Return the opposite direction.
	 */
	public Direction opposite(){
		
		if(this == NORTH){ return SOUTH;}
		else if(this == SOUTH){ return NORTH;}
		else if(this == EAST){ return WEST;}
		else if(this == WEST){ return EAST;}
		return UNKNOWN;
	}
	
}
